package com.management.demo.service;

import io.minio.messages.Bucket;
import org.springframework.web.multipart.MultipartFile;

import java.io.InputStream;
import java.util.List;

public interface MinIOService {

    // 创建存储桶
    void createBucket(String bucketName) throws Exception;

    // 上传文件
    void uploadFile(String bucketName, String objectName, MultipartFile file) throws Exception;

    // 下载文件
    InputStream downloadFile(String bucketName, String objectName) throws Exception;

    // 删除文件
    void deleteFile(String bucketName, String objectName) throws Exception;

    // 获取文件URL
    String getObjectUrl(String bucketName, String objectName, int expiry) throws Exception;

    // 获取文件URL
    String getObjectUrl(String objectName) throws Exception;

    // 获取所有存储桶
    List<Bucket> listBuckets() throws Exception;

    // 检查存储桶是否存在
    boolean bucketExists(String bucketName) throws Exception;
}
